﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace QuanLyBepAnTuThien
{
    public partial class frmInPhieuChi : Form
    {
        public frmInPhieuChi()
        {
            InitializeComponent();
        }
        connect cn = new connect();
        private void frmInPhieuChi_Load(object sender, EventArgs e)
        {           
            Report.rpInPhieuChi rpinphieu = new Report.rpInPhieuChi();
            SqlCommand cmd = new SqlCommand("tblChiTietChiTieu_DS", cn.ketnoi());
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add(new SqlParameter("machi", SqlDbType.Int)).Value = bientinhChiTieu.Machi;
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            DataTable dt = new DataTable();
            da.Fill(dt);
            rpinphieu.SetDataSource(dt);
            rpinphieu.SetParameterValue("tennhanvien",bientinhChiTieu.Hoten);
            rpinphieu.SetParameterValue("ngaychi",bientinhChiTieu.Ngaychi);
            rpinphieu.SetParameterValue("manhanvien",bientinhChiTieu.Manv);
            rpinphieu.SetParameterValue("tongtien",bientinhChiTieu.Tongtien);
            rpinphieu.SetParameterValue("bangchu",bientinhChiTieu.Bangchu);
            rpinphieu.SetParameterValue("nguoilap",login.Hoten);
            crstViewPhieuChi.ReportSource = rpinphieu;
        }
    }
}
